<?php
/**
 * Created by PhpStorm.
 * User: zhan
 * Date: 2018/12/11  14:28
 */
namespace app\admin\controller;
use app\admin\controller\Common;
use think\Db;

class Registration extends Common
{

    /*
	*	构造函数
	*/

    //列表
    public function lists(){

        $list = db('registration_agreement')->find();

        $this->assign('list',$list);0
        
        return $this->fetch();
    }


    public function edit(){

        $data['id'] = input('id');
        //var_dump($id);die;
        if(request()->isAjax()){

            $param = request()->param();

            $data['content'] = $param['content'];
            //$navid = $param['navid'];

           // if(!empty($son_name['article_category_name'])&&!empty($navid)){
            db('registration_agreement')->update($data);
            //}
            
            $this->success('修改成功！',url('Registration/lists'));die;
        }

        $list = db('registration_agreement')->find();
        //dump($list);die;
        $this->assign('list',$list);
       //dump($list);die;
        return $this->fetch();
    }

}